package com.example.youtube;

import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import model.Video;

public class ThumbController {
    @FXML
    private Label channel;

    @FXML
    private Label date;

    @FXML
    private Label name;

    @FXML
    private ImageView profile;

    @FXML
    private ImageView thumb;

    @FXML
    private Label views;

    public void setData(Video video){
        Image image = new Image(getClass().getResourceAsStream(video.getThumbSrc()));
        thumb.setImage(image);
        image = new Image(getClass().getResourceAsStream(video.getProfileSrc()));
        profile.setImage(image);
        channel.setText(video.getChannel());
        name.setText(video.getName());
        views.setText(video.getViews());
        date.setText(video.getDate());
    }
}
